<% /* $Id: submissions.jsp 105 2011-01-20 20:51:08Z altdotua@gmail.com $ */ %>

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>

<%@ include file="../header.jsp" %>

<h2 align="center">Перелік спроб</h2>
<table border="1">
	<tr>
		<th>#</th>
		<th>Tm</th>
		<th>Pr</th>
		<th>Lng</th>
		<th>Usr</th>
		<th>Code</th>
		<th>Judg</th>
		<th>Score</th>
		<th>Test</th>
		<th>Time</th>
		<th>Mem</th>
		<th>DJFlag</th>
		<th>Active</th>
		<th>SD</th>
		<th colspan="4">Actions</th>
	</tr>
<%
	Map<String, Object> map = new HashMap<String, Object>();
	map.put("contestId", contest.getId());
	List<SubmissionEntry> entries = SubmissionsModel.getSubmissions(map);
	Map<Long, UserEntry> usersMap = UsersModel.getEntriesMap();
	Map<Long, LanguageEntry> languagesMap = LanguagesModel.getEntriesMap();
	Map<Long, ContestProblemEntry> problemsMap = ContestProblemsModel.getEntriesMap();
	for (SubmissionEntry submission: entries)
	{
%>
		<tr>
			<td><%= submission.getId() %></td>
			<td><%= submission.getSubmissionTime() %></td>
			<td><%= problemsMap.get(submission.getContestProblemId()).getSid() %></td>
			<td><%= languagesMap.get(submission.getLanguageId()).getSid() %></td>
			<td><%= ((UserEntry)usersMap.get(submission.getUserId())).getUsername() %></td>
			<td><a href="<%= Linker.link("source.jsp?submission_id=" + submission.getId()) %>"><%= submission.getSourceSize() %></a></td>
			<td><a href="<%= Linker.link("submission.jsp?submission_id=" + submission.getId()) %>"><%= submission.getJudgement() %></a></td>
			<td><a href="<%= Linker.link("submission.jsp?submission_id=" + submission.getId()) %>"><%= submission.getScore() %></a></td>
			<td><%= submission.getWrongTestNumber() %></td>
			<td><%= submission.getMaxTimeUsed() %></td>
			<td><%= submission.getMaxMemoryUsed() %></td>
			<td><%= submission.getDjudgeFlag() %></td>
			<td><%= submission.getActive() %></td>
			<td><a href="<%= Linker.link("admin/submissiondetails.jsp?submissiondetails_id=" + submission.getSubmissionDetailsId()) %>"><%= submission.getSubmissionDetailsId() %></a></td>
			<td><a href="<%= Linker.link("contests/admin/submission.jsp?contest_id=" + contest.getId() + "&submission_id=" + submission.getId() + "&return=" + requestUrlEncoded) %>">Edit</a></td>
			<td><a href="<%= Linker.link("submissions?action=rejudge&id=" + submission.getId() + "&contest_id=" + contest.getId() + "&return=" + requestUrlEncoded) %>">Rejudge</a></td>
		</tr>
		<%
	}
%>
</table>


<%@ include file="../footer.jsp" %>
